// 字典管理API接口
import request from '../util/request';

// 字典类型相关API
export const getDictionaryTypesApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/dictionary/getDictionaryTypes`,
    method: 'post',
    data,
  });
};

// 字典数据相关API
export const getDictionaryApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/dictionary/getDictionary`,
    method: 'post',
    data,
  });
};

export const addDictionaryApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/dictionary/addDictionary`,
    method: 'post',
    data,
  });
};

export const updateDictionaryApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/dictionary/updateDictionary`,
    method: 'post',
    data,
  });
};

export const toggleDictionaryStatusApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/dictionary/toggleDictionaryStatus`,
    method: 'post',
    data,
  });
};

// 根据字典类型获取字典项（获取所有状态）
export const getDictionaryByTypeApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/dictionary/getDictionaryByType`,
    method: 'post',
    data,
  });
};